<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Inserir Funcionario</title>
            <script src="../midia/scripts/mascaras.js"></script>
    </h:head>
    <h:body>
        <ui:include src="../layout/menu.xhtml" />
        <div id="corpo">
            <f:view>
                <h:form>
                    <fieldset>
                        <legend>Funcionario</legend>
                        
                        <h:panelGrid columns="2" id="panel">                            
                            <h:outputLabel for="nome" value="Nome *" />  
                            <h:inputText id="nome" size="60" value="#{funcionarioBean.funcionario.nome}">  
                            </h:inputText>  
                            
                            <h:outputLabel for="email" value="Email" />  
                            <h:inputText id="email" size="60" value="#{funcionarioBean.funcionario.email}">  
                            </h:inputText>  
                                            
                            <h:outputLabel for="fone" value="Telefone *" />  
                            <h:inputText id="fone" onkeypress="mascara(this, mascaraTelefone)" maxlength="15" value="#{funcionarioBean.funcionario.fone}">  
                            </h:inputText>  
                            
                            <h:outputLabel for="cidade" value="Cidade" />  
                            <h:inputText id="cidade" value="#{funcionarioBean.funcionario.cidade}">  
                            </h:inputText>  
                            
                            <h:outputLabel for="logradouro" value="Logradouro" />  
                            <h:inputText id="logradouro" value="#{funcionarioBean.funcionario.logradouro}">  
                            </h:inputText>                             
                           
                            <h:outputLabel for="funcao" value="Funcao" />  
                            <p:selectOneMenu id="funcao"
                                value="#{funcionarioBean.funcionario.funcao.codigo}">
                                <f:selectItems value="#{funcaoBean.listFuncao}" var="f"
                                itemLabel="#{f.nome}"  itemValue="#{f.codigo}" />
                            </p:selectOneMenu>
                            
                            <h:outputLabel for="setor" value="Setor" />  
                            <p:selectOneMenu
                                value="#{funcionarioBean.funcionario.setor.codigo}">
                                <f:selectItems value="#{setorBean.listSetor}" var="s"
                                itemLabel="#{s.descricao}"  itemValue="#{s.codigo}" />
                            </p:selectOneMenu>
                            
                            <h:commandButton value="Inserir" action="#{funcionarioBean.inserir}"></h:commandButton>
                            
                            <h:commandButton value="Limpar" action="#{funcionarioBean.limpar}"></h:commandButton>
                        </h:panelGrid>
                    </fieldset>
                </h:form>                
            </f:view>
        </div>
        <ui:include src="../layout/rodape.xhtml" />
    </h:body>
</html>